home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / DEVICES / MOUSE2.PAS < prev    next >
Pascal/Delphi Source File  |  1996-08-01  |  1KB  |  33 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Demonstration; mouse handling #2 - double clicking
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBDEF, EFLIBSCR, EFLIBKBD, EFLIBMSE, EFLIBTXT;
  10.  
  11. const MyField : FieldType = (Start : (X : 1; Y : 1);
  12.                              Stop : (X : 80; Y : 1));
  13.  
  14. var DoubleClickHandler : ClickHandlerObjectType;
  15.  
  16. begin
  17.      DoubleClickHandler.Initialize;
  18.      Mouse.ShowCursor;
  19.      repeat
  20.            with DoubleClickHandler, Mouse, Screen do begin
  21.                 if ButtonPressed then RegisterPress;
  22.                 if IsDoubleClicked then begin
  23.                    { Handle double click }
  24.                    Write ('Double click');
  25.                    if IsDoubleClickedInField (MyField) then
  26.                       WriteLn (' on first line.') else WriteLn ('!');
  27.                    { Remove double clicked registration }
  28.                    DoubleClickHandler.Reset;
  29.                 end;
  30.                 repeat until not ButtonPressed;
  31.            end;
  32.      until Keyboard.KeyPressed;
  33. end.